]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
mpris: Only expose the players that can play
authorMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 16 Apr 2026 16:35:57 +0000 (18:35 +0200)
committerMarco Trevisan (Treviño) <mail@3v1n0.net>
Thu, 16 Apr 2026 17:51:23 +0000 (19:51 +0200)
In mpris we only emit "player-added" for players that can actually play,
but during NotificationBox and MessageList initialization we add them all,
including those not having being technically added.

And this may be a problem when locking the screen, since we do not want
players to show if they cannot play.

So, be consistent and expose publicly only the players that can play

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4183>

js/ui/mpris.js

index 1ab2d40379547562d8fe877c1ddcc6dcf4816fd8..44efbd64e1b69e4a1b2791875fd86825cc4a4fee 100644 (file)
@@ -204,7 +204,7 @@ export const MprisSource = GObject.registerClass({
     }
 
     get players() {
-        return [...this._players.values()];
+        return [...this._players.values()].filter(player => player.canPlay);
     }
 
     _addPlayer(busName) {